module.exports = (sql, params) => {
    const mysql = require('mysql');
    const conn = mysql.createConnection({
        host: 'localhost',
        password: 'root',
        user: 'root',
        database: 'bigevent',
        timezone: '+HH:MM',
    });
    conn.connect();
    return new Promise((resolve, reject) => {
        conn.query(sql, params, (err, data) => {
            err ? reject(err) : resolve(data);
        })
        conn.end();
    }).catch(err => { console.log(err.message) });
}